﻿@model Solution.Business.Entities.News

<script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("select#TinhId").change(function (evt) {

            if ($("select#TinhId").val() != null) {

                $.ajax({
                    url: "/MenuSearch/GetQuanId",
                    type: 'POST',
                    data: { TinhId: $("select#TinhId").val() },
                    success: function (response) {
                        $("select#QuanId").replaceWith(response)
                    },
                    error: function (xhr) {
                        alert("Something went wrong, please try again");
                    }
                });
            }
        });
    });
</script>

<script type="text/javascript">
    $(function () {
        $("select#TrId").change(function (evt) {

            if ($("select#TrId").val() != null) {

                $.ajax({
                    url: "/MenuSearch/Phanloai",
                    type: 'POST',
                    data: { TrId: $("select#TrId").val() },
                    success: function (response) {
                        $("select#Phanloai").replaceWith(response)
                    },
                    error: function (xhr) {
                        alert("Something went wrong, please try again");
                    }
                });
            }
        });
    });
</script>

<script type="text/javascript">
    $(function () {
        $("select#TrId").change(function (evt) {

            if ($("select#TrId").val() != null) {

                $.ajax({
                    url: "/MenuSearch/Gia",
                    type: 'POST',
                    data: { TrId: $("select#TrId").val() },
                    success: function (response) {
                        $("select#Gia").replaceWith(response)
                    },
                    error: function (xhr) {
                        alert("Something went wrong, please try again");
                    }
                });
            }
        });
    });
</script>
@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
       <ul style="display:inline; list-style-type:none;">
           <li style="display:inline; float:left; width:115px;">
                @Html.DropDownList("TinhId", "Tỉnh/Thành Phố")
                @Html.ValidationMessageFor(model => model.Location.LId)
           </li>

           <li style="display:inline; float:left; width:115px; margin-left:5px;">
               <select id="QuanId" name="QuanId">
                   <option value="0">Quận/Huyện</option>
                </select>
           </li>

           <li style="display:inline; float:left; margin-left:5px;">
                @Html.DropDownList("TrId", "Bán/Thuê")
                @*@Html.ValidationMessageFor(model => model.Transaction.TrId)*@
           </li>

           <li style="display:inline; float:left; margin-left:5px;">
               <select id="Phanloai" name="Phanloai">
                   <option value="0">Phân loại</option>
                </select>
           </li>

           <li style="display:inline; float:left; margin-left:5px;">
               <select id="Gia" name="Gia">
                   <option value="0">Khung giá</option>
                </select>
           </li>

           <li style="display:inline; float:left; margin-left:5px;">
                @Html.DropDownList("Khungdientich", "Khung diện tích")     
           </li>

           <li style="display:inline; float:left; width:135px; margin-left:5px;">
                <input type="text" name="txtSearch" id="txtSearch" style="width:135px;"/>
           </li>

           <li style="display:inline; float:left; margin-left:9px;">
                <input type="submit" name="submitButton" value="Search"  style="width:75px; padding: 1px 5px; color: #bd0100; font-weight: bold;"/>
           </li>
       </ul>
    
}

